package com.dubbo.customer.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.dubbo.domain.User;
import com.dubbo.service.UserService;

@RestController
@RequestMapping("/dubbo")
public class DubboController {
	
  @com.alibaba.dubbo.config.annotation.Reference
	private UserService userService;

	@RequestMapping(value = "/hello", method = { RequestMethod.GET, RequestMethod.POST })
	public String hello(HttpServletRequest request, HttpServletResponse response) {
		User user = userService.getUser(1l);
		System.out.println("消费者......" + user.getName());
		return "成功";
	}

}
